package learn.ch1;

/**
 * @Description todo
 * @Author yusj
 * @Date 2021/12/12
 * @Version 1.0
 */
public class Ts01 extends Thread{

    private Sv01 sv01;

    public Ts01(Sv01 sv01,String name){
        this.sv01=sv01;
        super.setName(name);
    }

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
            sv01.done();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args){
        Sv01 sv01=new Sv01();

        Ts01 ts01_1=new Ts01(sv01,"ts01_1");
        Ts01 ts01_2=new Ts01(sv01,"ts01_2");

        ts01_1.start();
        ts01_2.start();





    }

}
